package com.bank.model;

public class Transaction implements Comparable<Transaction>{
    private String tid;
    private String amount;
    private String time;
    private String cardId;

    public Transaction() {
    }

    public Transaction(String tid, String amount, String time, String cardId) {
        this.tid = tid;
        this.amount = amount;
        this.time = time;
        this.cardId = cardId;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    @Override
    public String toString() {
        return "Transaction{" +
                "tid='" + tid + '\'' +
                ", amount='" + amount + '\'' +
                ", time='" + time + '\'' +
                ", cardId='" + cardId + '\'' +
                '}';
    }

    @Override
    public int compareTo(Transaction o) {
        return this.time.compareTo(o.time);
    }

}
